package ink.metoo.gude.module.security.domain.vo

import ink.metoo.gude.module.security.domain.ddl.User

data class UserDetailsVO(
    val id: Long,
    var account: String? = null,
    val nickname: String,
    val email: String,
    val roles: List<String?>,
    val avatar: String? = null
) {
    constructor(user: User) : this(
        id = user.id!!,
        nickname = user.nickname!!,
        account = user.account!!,
        email = user.email!!,
        roles = user.roles.map { it.name },
        avatar = user.avatar
    )
}